<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>出差补助单</title>
    <link rel="stylesheet" href="../../../css/aui.css" />
    <link rel="stylesheet" href="../../../css/my/apply.css"/>
    <link rel="stylesheet" href="../../../css/trip/apply/date.css">
    <link rel="stylesheet" href="../../../css/iconfont/iconfont.css"/>
    <link rel="stylesheet" href="../../../script/widget/Zepto/dropload.css"/>
    <style>
        .dropload-down{height: 0;}
    </style>
</head>
<body style="cursor: pointer">
    <div class="aui-tab" id="a">
        <div class="aui-tab-item aui-active">我的</div>
        <div class="aui-tab-item">待我审批的</div>
    </div>
    <div id="tab"></div>
</body>
</html>
<script type="text/javascript" src="../../../script/aui/api.js"></script>
<script type="text/javascript" src="../../../script/aui/aui-toast.js"></script>
<script type="text/javascript" src="../../../script/extend/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="../../../script/extend/doT.min.js"></script>
<script type="text/javascript" src="../../../script/widget/Zepto/dropload.min.js"></script>
<script type="text/javascript" src="../../../script/extend/picker.min.js"></script>
<script type="text/javascript" src="../../../script/common.js"></script>
<script type="text/javascript" src="../../../script/config.js"></script>
<script type="text/javascript" src="../../../service/index/order.js"></script>


<!--列表模板 start-->
<script id="list_tpl" type="text/x-dot-template">
    {{ for(var prop in it) { }}
	<div class="apply_style" style="margin-top: 10px;">
        <div class="icon_order travel_info" data-id="{{= it[prop]['id']}}">
            <i class="iconfont icon-feiji2" style="font-size: 1.5rem;color: #3CB0D6;float: left;"></i>
            <span class="color-blue">补助单号：{{= it[prop]['allowance_code'] }}</span>
            {{ if(it[prop]['status'] == 0){ }}
            <span class="await">{{= it[prop]['status_name'] }}</span>
            {{ }else if(it[prop]['status'] == 2){ }}
                {{ if(it[prop]['finance_status'] == 0){ }}
                <span class="pass">{{= it[prop]['status_name'] }}</span>
                {{ }else if(it[prop]['finance_status'] == 1){ }}
                <span class="pass">{{= it[prop]['finance_status_name'] }}</span>
                {{ } }}
            {{ }else if(it[prop]['status'] == 3){ }}
            <span class="await">{{= it[prop]['status_name'] }}</span>
            {{ }else if(it[prop]['status'] == 1){ }}
            <span class="await">{{= it[prop]['status_name'] }}</span>
            {{ }else if(it[prop]['status'] == 4){ }}
            <span class="await" style="color: gray;">{{= it[prop]['status_name'] }}</span>
            {{ } }}
        </div>
        <p class="font_color">时间：{{= it[prop]['create_time'] }}</p>
        <p class="font_color">审批人：{{= it[prop]['approver_name'] }}</p>
        <p class="font_color">申请人：{{= it[prop]['book_user']['user_name'] }}</p>
        {{ if(it[prop]['status'] == 0){ }}
            <div class="font_color" style="text-align: right;">
            {{ if(it[prop]['approve_info']['is_current'] == 1){ }}
            {{ } }}
            {{ if(it[prop]['approve_info']['is_mine'] == 1){ }}
                <div class="aui-btn aui-btn-default cancel" data-id="{{=it[prop]['id']}}" style="margin-left: 1rem;">取消</div>
            {{ } }}
            </div>
        {{ } }}


        {{ if(it[prop]['finance_status'] == 0 && it[prop]['status'] == 2 && it[prop]['approve_info']['is_mine'] == 1){ }}
        <div class="font_color" style="text-align: right;">
            <div class="aui-btn aui-btn-info invalid" data-id="{{=it[prop]['id']}}">作废</div>
        </div>

        {{ } }}
    </div>

    {{ } }}
</script>
<!--列表模板 end-->

<script type="text/javascript">
    apiready = function() {
        api.parseTapmode();

        new order({
            orderName            : '报销单'                            //xx单名称
            ,mineListInterface   : Config.travel.allowanceListMine     //我的报销单接口
            ,otherListInterface  : Config.travel.allowanceListApprove  //待我审批的报销单接口
            ,cancelInterface     : Config.travel.allowanceCancel       //取消接口
            ,invalidInterface    : Config.travel.allowanceInvalid      //作废接口
            ,winName             : 'travel_allowance_info_win'         //打开新窗口报销单的名称
            ,storageId           : 'allowance_id'                      //存储storageId的名称
        });
    };
</script>